package cn.zcy.springboot_mybatis.controller;

import cn.zcy.springboot_mybatis.domain.Dept;
import cn.zcy.springboot_mybatis.result.Result;
import cn.zcy.springboot_mybatis.service.IDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("dept")
public class DeptController {

    @Autowired
    private IDeptService deptService;
    @GetMapping("/list")
    public Result selectList(){
       List<Dept> list= deptService.selectList();
        return new Result(200,"查询成功",list);
    }

}
